<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<html>

	<head>
    	<link href="<s:url value="/resources/main.css"/>" rel="stylesheet" type="text/css"/>
   	
   		<!-- load the dojo toolkit base -->
		<script type="text/javascript" src="js/dojo-release-1.1.1/dojo/dojo.js"
	    	djConfig="parseOnLoad:true, isDebug:true"></script>
	    	
	    <script language="javascript"></script>
	</head>
	
	<body background="resources/img/blancocubista.jpg">	
		<h1><s:text name="label.proveedores"/></h1>		   
		
		<table width=600 align=center>
	    	<tr><s:url id="insertP" action="setUpForInsertOrUpdateProv"/>
	         	<td><s:a href="%{insertP}">Agregar un nuevo proveedor</s:a></td>
	     	</tr>
		</table>
		
		<br/>
		
	<table align=center class="borderAll">
    	<tr>
        	<th><s:text name="label.nombre"/></th>
        	<th>&nbsp;</th>
    	</tr>
    	<s:iterator value="proveedores" status="status">
        	<tr class="<s:if test="#status.even">even</s:if><s:else>odd</s:else>">
            	<td class="nowrap"><s:property value="nombre"/></td>
            	<td class="nowrap">
                	<s:url id="update" action="setUpForInsertOrUpdateProv">
		       		   <s:param name="proveedor.proveedorId" value="proveedorId"/>
		       		</s:url> 
                <s:a href="%{update}">Edit</s:a>
                &nbsp;&nbsp;&nbsp;
                	<s:url id="deleteProv" action="deleteProv">
		       		   <s:param name="proveedor.proveedorId" value="proveedorId"/>
		       		</s:url>
                <s:a href="%{deleteProv}">Delete</s:a>
				&nbsp;&nbsp;&nbsp;
					<s:url id="showFacturasProv" action="showFacturasProv">
		       		   <s:param name="proveedor.proveedorId" value="proveedorId"/>
		       		</s:url>
				<s:a href="%{showFacturasProv}">Ver Facturas</s:a>
            </td>

			
        </tr>  		
	 </s:iterator>
    </table>
    
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>

	<table align="center" width=600>
	
	<tr align="center">
	<s:url id="verFacturas" action="getAllFacturas.action"/>
	<td><s:a href="%{verFacturas}"><img src="resources/img/factura.gif" width="30" height="40" onmouseover="document.images[0].src='resources/img/factura2.gif'; return true;" onmouseout="document.images[0].src='resources/img/factura.gif'; return true;"></s:a>
	<br><center>Ver Facturas</center>
	</td>
	</tr>
	</table>	
</body>
</html>